package com.forum.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;

@Data
@TableName("chat")
public class ChatEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    public ChatEntity() {

    }

    public ChatEntity(T t) {
        try {
            BeanUtils.copyProperties(this, t);
        } catch (IllegalAccessException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    /**
     * 主键
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat
    private Date addtime;

    /**
     * 用户--管理员Id
     */
    @TableField("Userid")
    private Long userid;

    /**
     * 管理员--id
     */
    @TableField("Adminid")
    private Long adminid;

    /**
     * 提问
     */
    @TableField("Ask")
    private String ask;

    /**
     * 回复
     */
    @TableField("Reply")
    private String reply;

    /**
     * 回复状态
     */
    @TableField("Isreply")
    private Long isreply;
}
